#pragma once

#include "vector.h"
#include "vectorExpr.h"
#include "matrix.h"
#include "matrixExpr.h"
namespace math{
   static float lerp(const float& v1, const float& v2, const float& weight) {
		return v2 * weight + (1.0f - weight) * v1;
	}

	static vec2f lerp(const vec2f& v1, const vec2f& v2, const float& weight) {
		return from_expr(v2 * weight + v1 * (1.0f - weight));
	}

	static vec3f lerp(const vec3f& v1, const vec3f& v2, const float& weight) {
		return from_expr(v2 * weight + v1 * (1.0f - weight));
	}

	static vec4f lerp(const vec4f& v1, const vec4f& v2, const float& weight) {
		return from_expr(v2 * weight + v1 * (1.0f - weight));
	}

	static float lerp(const float& v1, const float& v2, const float& v3, const float& weight1, const float& weight2, const float& weight3) {
		return v1 * weight1 + v2 * weight2 + v3 * weight3;
	}

	static vec2f lerp(const vec2f& v1, const vec2f& v2, const vec2f& v3, const float& weight1, const float& weight2, const float& weight3) {
		return from_expr(v1 * weight1 + v2 * weight2 + v3 * weight3);
	}

	static vec3f lerp(const vec3f& v1, const vec3f& v2, const vec3f& v3, const float& weight1, const float& weight2, const float& weight3) {
		return from_expr(v1 * weight1 + v2 * weight2 + v3 * weight3);
	}

	static vec4f lerp(const vec4f& v1, const vec4f& v2, const vec4f& v3, const float& weight1, const float& weight2, const float& weight3) {
		return from_expr(v1 * weight1 + v2 * weight2 + v3 * weight3);
	}
}